home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / applic / ntp / doc / ntp.txt.Z / ntp.txt
Encoding:
Text File  |  1991-09-29  |  66.8 KB  |  1,301 lines

  1. @TITLE = Internet Time Synchronization: the Network Time Protocol<$FTo
  2. appear in: Mills, D.L. Internet time synchronization: the Network Time
  3. Protocol. IEEE Transactions on Communications. Distribution is
  4. restricted pending publication.> <$FSponsored by: Defense Advanced
  5. Research Projects Agency contract number N00140-87-C-8901 and by
  6. National Science Foundation grant number NCR-89-13623.>
  7.  
  8. @AUTHOR = David L. Mills
  9. Electrical Engineering Department
  10. University of Delaware
  11.  
  12. @AUTHOR = Abstract
  13.  
  14. @ABSTRACT = This paper describes the Network Time Protocol (NTP), which
  15. is designed to distribute time information in a large, diverse internet
  16. system operating at speeds from mundane to lightwave. It uses a
  17. symmetric architecture in which a distributed subnet of time servers
  18. operating in a self-organizing, hierarchical configuration synchronizes
  19. local clocks within the subnet and to national time standards via wire,
  20. radio or calibrated atomic clock. The servers can also redistribute time
  21. information within a network via local routing algorithms and time
  22. daemons.
  23.  
  24. @ABSTRACT = This paper also discusses the architecture, protocol and
  25. algorithms, which were developed over several years of implementation
  26. refinement and resulted in the designation of NTP as an Internet
  27. Standard protocol. The NTP synchronization system, which has been in
  28. regular operation in the Internet for the last several years, is
  29. described along with performance data which shows that timekeeping
  30. accuracy throughout most portions of the Internet can be ordinarily
  31. maintained to within a few milliseconds, even in cases of failure or
  32. disruption of clocks, time servers or networks.
  33.  
  34. Keywords: network clock synchronization, standard time distribution,
  35. fault-tolerant architecture, maximum-likelihood principles, disciplined
  36. oscillator, internet protocol.
  37.  
  38. @HEAD LEVEL 1 =  Introduction
  39.  
  40. Accurate, reliable time is necessary for financial and legal
  41. transactions, transportation and distribution systems and many other
  42. applications involving widely distributed resources. How do hosts in a
  43. large, dispersed networking community know what time it is? How accurate
  44. are their clocks? In a recent survey involving 94,260 hosts of the
  45. Internet system, 20,758 provided local time using three time-transfer
  46. protocols [24]. About half of the replies had errors greater than two
  47. minutes, while ten percent had errors greater than four hours. A few had
  48. errors over two weeks. Most local clocks are set by eyeball-and-
  49. wristwatch to within a minute or two and rarely checked after that. Many
  50. of these are maintained by some sort of battery-backed clock-calendar
  51. device using a room-temperature quartz oscillator that may drift as much
  52. as a second per day and can go for weeks between manual corrections. For
  53. many applications, especially distributed internet applications, much
  54. greater accuracy and reliability is required.
  55.  
  56. This paper presents an overview of the architecture, protocol and
  57. algorithms of the Network Time Protocol (NTP) used in the Internet
  58. system to synchronize clocks and coordinate time distribution. The
  59. Internet consists of over 100,000 hosts on over 1500 packet-switching
  60. networks interconnected by a similar number of gateways. In this paper
  61. the capitalized Internet refers to this particular system, while the
  62. uncapitalized internet refers to any generic system of multiple networks
  63. interconnected by gateways. While the Internet backbone networks and
  64. gateways are carefully engineered for good service, operating speeds and
  65. service reliability vary considerably throughout the system. This places
  66. severe demands on NTP, which must deliver accurate and reliable time in
  67. spite of component failures, service disruptions and possibly mis-
  68. engineered implementations.
  69.  
  70. In the remainder of this introductory Section 1, issues in the
  71. requirements, approaches and comparisons with previous work are
  72. discussed. The architecture of the NTP synchronization system, including
  73. the primary reference sources and distribution mechanisms, is described
  74. in Section 2. An overview of the NTP protocol and modes of operation is
  75. given in Section 3. Section 4 describes the algorithms used to improve
  76. the accuracy of measurements made over Internet paths and to select the
  77. best from among a set of available clocks for synchronization. Section 5
  78. describes a local-clock design based on a type of phase-lock loop and
  79. capable of long-term accuracies to the order of a few milliseconds. The
  80. international NTP synchronization system of time servers now operating
  81. in the Internet is described and its performance assessed in Section 6.
  82. Section 7 discusses further development and issues for future research.
  83. This paper itself is an updated and condensed version of [23].
  84.  
  85. @HEAD LEVEL 2 =  Definitions
  86.  
  87. In this paper the stability of a clock is how well it can maintain a
  88. constant frequency, the accuracy is how well its time compares with
  89. national standards and the precision is how precisely time can be
  90. resolved in a particular timekeeping system. The offset of two clocks is
  91. the time difference between them, while the skew is the frequency
  92. difference between them. The reliability of a timekeeping system is the
  93. fraction of the time it can be kept operating and connected in the
  94. network (without respect to stability and accuracy). Local clocks are
  95. maintained at designated time servers, which are timekeeping systems
  96. belonging to a synchronization subnet, in which each server measures the
  97. offsets between its local clock and the clocks of its neighbor servers
  98. or peers in the subnet. In this paper to synchronize frequency means to
  99. adjust the clocks in the subnet to run at the same frequency, to
  100. synchronize time means to set them to agree at a particular epoch with
  101. respect to Coordinated Universal Time (UTC), as provided by national
  102. standards, and to synchronize clocks means to synchronize them in both
  103. frequency and time.
  104.  
  105. @HEAD LEVEL 2 =  Performance Requirements
  106.  
  107. Internet transmission paths can have wide variations in delay and
  108. reliability due to traffic load, route selection and facility outages.
  109. Stable frequency synchronization requires stable local-clock oscillators
  110. and multiple offset comparisons over relatively long periods of time,
  111. while reliable time synchronization requires carefully engineered
  112. selection algorithms and the use of redundant resources and diverse
  113. transmission paths. For instance, while only a few offset comparisons
  114. are usually adequate to determine local time in the Internet to within a
  115. few tens of milliseconds, dozens of measurements over some days are
  116. required to reliably stabilize frequency to a few milliseconds per day.
  117. Thus, the performance requirements of an internet-based time
  118. synchronization system are particularly demanding. A basic set of
  119. requirements must include the following:
  120.  
  121. @INDENT HEAD = 1.
  122.  
  123. @INDENT = The primary reference source(s) must be synchronized to
  124. national standards by wire, radio or calibrated atomic clock. The time
  125. servers must deliver continuous local time based on UTC, even when leap
  126. seconds are inserted in the UTC timescale.
  127.  
  128. @INDENT HEAD = 2.
  129.  
  130. @INDENT = The time servers must provide accurate and precise time, even
  131. with relatively large delay variations on the transmission paths. This
  132. requires careful design of the filtering and combining algorithms, as
  133. well as an extremely stable local-clock oscillator and synchronization
  134. mechanism.
  135.  
  136. @INDENT HEAD = 3.
  137.  
  138. @INDENT = The synchronization subnet must be reliable and survivable,
  139. even under unstable network conditions and where connectivity may be
  140. lost for periods up to days. This requires redundant time servers and
  141. diverse transmission paths, as well as a dynamically reconfigurable
  142. subnet architecture.
  143.  
  144. @INDENT HEAD = 4.
  145.  
  146. @INDENT = The synchronization protocol must operate continuously and
  147. provide update information at rates sufficient to compensate for the
  148. expected wander of the room-temperature quartz oscillators used in
  149. ordinary computer systems. It must operate efficiently with large
  150. numbers of time servers and clients in continuous-polled and procedure-
  151. call modes and in multicast and point-to-point configurations.
  152.  
  153. @INDENT HEAD = 5.
  154.  
  155. @INDENT = The system must operate in existing internets including a
  156. spectrum of machines ranging from personal workstations to
  157. supercomputers, but make minimal demands on the operating system and
  158. supporting services. Time-server software and especially client software
  159. must be easily installed and configured.
  160.  
  161. In addition to the above, and in common with other generic,
  162. promiscuously distributed services, the system must include protection
  163. against accidental or willful intrusion and provide a comprehensive
  164. interface for network management. In NTP address filtering is used for
  165. access control, while encrypted checksums are used for authentication.
  166. Network management presently uses a proprietary protocol with provisions
  167. to migrate to standard protocols where available.
  168.  
  169. @HEAD LEVEL 2 =  Discussion of Approaches
  170.  
  171. There are many ways that time servers distributed throughout a large
  172. geographic area can synchronize clocks to UTC. In North America the U.S.
  173. and Canada operate broadcast radio services with a UTC timecode
  174. modulation which can be decoded by suitable receivers. One approach to
  175. time synchronization is to provide timecode receivers at every site
  176. where required. However, these receivers are specialized, moderately
  177. expensive and subject to occasional gross errors due to propagation and
  178. equipment failures. A comprehensive summary of radio synchronization
  179. techniques can be found in [4].
  180.  
  181. The U.S. National Institute of Standards and Technology (NIST) (formerly
  182. National Bureau of Standards), recently announced a computer time
  183. service available to the general public by means of a standard telephone
  184. modem [26]. The service is intended for use by personal workstations to
  185. set clock-calendars, for example, but would not be suitable for a large
  186. population of clients calling on a frequent, regular basis without
  187. further redistribution.
  188.  
  189. In principle, it is possible to use special network facilities designed
  190. for time synchronization, such as timecode rebroadcasts on a dedicated
  191. FM or TV subcarrier or cable system. For many years AT&T has
  192. synchronized digital switching equipment to the Basic Synchronization
  193. Reference Frequency (BSRF), which consists of a master oscillator
  194. synchronized to UTC and a network of dedicated 2048-kHz links embedded
  195. in the transmission plant. AT&T and other carriers are planning to use
  196. the Global Positioning System and the LORAN-C radionavigation system to
  197. synchronize switches in various areas of the country. However, neither
  198. of these methods would be economically viable for widespread deployment
  199. in a large, diverse internet system.
  200.  
  201. Current network clock synchronization techniques have evolved from both
  202. linear systems and Byzantine agreement methodologies. Linear methods for
  203. digital telephone network synchronization are summarized in [16], while
  204. Byzantine methods for clock synchronization are summarized in [15].
  205. While reliable clock synchronization has been studied using agreement
  206. algorithms [15], [33], in practice it is not possible to distinguish the
  207. truechimer clocks, which maintain timekeeping accuracy to a previously
  208. published (and trusted) standard, from the falseticker clocks, which do
  209. not, on other than a statistical basis. In addition, the algorithms
  210. discussed in the literature do not necessarily produce the most accurate
  211. and precise time on a statistical basis and may produce unacceptable
  212. network overheads and instabilities in a large, diverse internet system.
  213.  
  214. In an internet system involving many networks and gateways a useful
  215. approach is to equip a few strategically located hosts or gateways with
  216. timecode receivers or calibrated atomic clocks and coordinate time
  217. distribution using a suitable protocol. Various Internet protocols have
  218. been used to record and transmit the time at which an event takes place,
  219. including the Daytime protocol [28], Time protocol [29], ICMP Timestamp
  220. message [7] and IP Timestamp option [34]. The Unix 4.3bsd time daemon
  221. timed uses an elected master host to measure offsets of a number of
  222. slave hosts and send periodic corrections to them [11]. While addressing
  223. no particular protocol architecture, the schemes proposed in [6] have
  224. features in common with NTP, including master-slave synchronization with
  225. provisions for failures and changing system load. However, none of these
  226. protocols includes engineered algorithms to compensate for the effects
  227. of statistical delay variations encountered in wide-area networks and
  228. are unsuitable for precision time distribution throughout the Internet.
  229.  
  230. It became evident, as the algorithms used in NTP evolved over a nine-
  231. year period of experiment and stepwise refinement, that accurate and
  232. reliable internet time synchronization can be achieved only through an
  233. integrated approach to system design, including the primary reference
  234. sources, time servers, synchronization subnets, protocols and
  235. synchronization mechanisms which are at the heart of this paper. From an
  236. analytical point of view the distributed system of NTP time servers
  237. operates as a hierarchically organized subnet of loosely coupled time
  238. servers which exchange periodic update messages containing precision
  239. timestamps to adjust local oscillator phase and frequency. The principal
  240. features of this design, described in more detail later in this paper,
  241. can be summarized as follows:
  242.  
  243. @INDENT HEAD = 1.
  244.  
  245. @INDENT = The synchronization subnet consists of a self-organizing,
  246. hierarchical network of time servers configured on the basis of
  247. estimated accuracy, precision and reliability.
  248.  
  249. @INDENT HEAD = 2.
  250.  
  251. @INDENT = The synchronization protocol operates in connectionless mode
  252. in order to minimize latencies, simplify implementations and provide
  253. ubiquitous interworking.
  254.  
  255. @INDENT HEAD = 3.
  256.  
  257. @INDENT = The synchronization mechanism uses a symmetric design which
  258. tolerates packet loss, duplication and mis-ordering, together with
  259. filtering, selection and combining algorithms based on maximum-
  260. likelihood principles.
  261.  
  262. @INDENT HEAD = 4.
  263. @INDENT = The local-clock design is based on a type II, adaptive-
  264. parameter, phase-lock loop with corrections computed using timestamps
  265. exchanged along the arcs of the synchronization subnet.
  266.  
  267. @INDENT HEAD = 5.
  268.  
  269. @INDENT = Multiply redundant time servers and multiply diverse
  270. transmission paths are used in the synchronization subnet, as well as
  271. engineered algorithms which select the most reliable synchronization
  272. source(s) and path(s) using weighted-voting procedures.
  273.  
  274. @INDENT HEAD = 6.
  275.  
  276. @INDENT = System overhead is reduced through the use of dynamic control
  277. of phase-lock loop bandwidths, poll intervals and association management
  278.  
  279. @HEAD LEVEL 1 =  Time Standards and Distribution
  280.  
  281. Since 1972 the time and frequency standards of the world have been based
  282. on International Atomic Time (TAI), which is currently maintained using
  283. multiple cesium-beam clocks to an accuracy of a few parts in 1012 [1].
  284. The International Bureau of Weights and Measures uses astronomical
  285. observations provided by the U.S. Naval Observatory and other
  286. observatories to determine corrections for small changes in the mean
  287. solar rotation period of the Earth, which results in Coordinated
  288. Universal Time (UTC). UTC is presently slow relative to TAI by a
  289. fraction of a second per year, so corrections in the form of leap
  290. seconds must be inserted in TAI from time to time in order to maintain
  291. agreement. The U.S. and many other countries operate standard time and
  292. frequency broadcast stations covering most areas of the world, although
  293. only a few utilize a timecode modulation suitable for computer use.
  294.  
  295. The NTP system consists of a network of primary and secondary time
  296. servers, clients and interconnecting transmission paths. A primary time
  297. server is directly synchronized to a primary reference source, usually a
  298. timecode receiver or calibrated atomic clock. A secondary time server
  299. derives synchronization, possibly via other secondary servers, from a
  300. primary server over network paths possibly shared with other services.
  301. Under normal circumstances clock synchronization is determined using
  302. only the most accurate and reliable servers and transmission paths, so
  303. that the actual synchronization paths usually assumes a hierarchical
  304. configuration with the primary reference sources at the root and servers
  305. of decreasing accuracy at increasing levels toward the leaves.
  306.  
  307. Following conventions established by the telephone industry, the
  308. accuracy of each time server is defined by a number called the stratum,
  309. with the reference level (primary servers) assigned as one and each
  310. succeeding level towards the leaves (secondary servers) assigned as one
  311. greater than the preceding level [2]. Using existing stations and
  312. available timecode receivers with computed propagation-delay
  313. corrections, accuracies in the order of a millisecond can be achieved at
  314. the network interface of a primary server. As the stratum increases from
  315. one, the accuracies achievable will degrade depending on the network
  316. paths and local-clock stabilities.
  317.  
  318. The synchronization subnet is organized using a variant of the Bellman-
  319. Ford distributed routing algorithm to compute the minimum-weight
  320. spanning trees rooted at the primary reference sources [3]. The distance
  321. metric is determined first by stratum, then by total roundtrip path
  322. delay to the root, called the synchronization distance. The timekeeping
  323. quality at a particular peer is determined by a sum of weighted offset
  324. differences, called the dispersion. The total dispersion to the root due
  325. to all causes is called the synchronization dispersion.
  326.  
  327. @HEAD LEVEL 1 =  Network Time Protocol
  328. The Network Time Protocol (NTP), now established as an Internet Standard
  329. protocol [22], is used to organize and maintain a set of time servers
  330. and transmission paths as a synchronization subnet. NTP is built on the
  331. Internet Protocol (IP) [8] and User Datagram Protocol (UDP) [27], which
  332. provide a connectionless transport mechanism; however, it is readily
  333. adaptable to other protocol suites. It is evolved from the Time Protocol
  334. [29] and the ICMP Timestamp Message [7], but is specifically designed to
  335. maintain accuracy and reliability, even when used over typical Internet
  336. paths involving multiple gateways and unreliable networks.
  337.  
  338. There are no provisions for peer discovery, configuration or acquisition
  339. in NTP itself, although some implementations include these features.
  340. Data integrity are provided by the IP and UDP checksums. No circuit-
  341. management, duplicate-detection or retransmission facilities are
  342. provided or necessary. The protocol can operate in several modes
  343. appropriate to different scenarios involving private workstations,
  344. public servers and various network configurations. A lightweight
  345. association-management capability, including dynamic reachability and
  346. variable poll-interval mechanisms, is used to manage state information
  347. and reduce resource requirements. Optional features include message
  348. authentication based on crypto-checksums and provisions for remote
  349. control and monitoring. Since only a single NTP message format is used,
  350. the protocol is easily implemented and can be used in a variety of
  351. operating-system and networking environments.
  352.  
  353. In NTP one or more primary servers synchronize directly to external
  354. reference sources such as timecode receivers. Secondary time servers
  355. synchronize to the primary servers and others in the synchronization
  356. subnet. A typical subnet is shown in Figure 1a,<$&fig1> in which the
  357. nodes represent subnet servers, with normal stratum numbers determined
  358. by the hop count to the root, and the heavy lines the active
  359. synchronization paths and direction of timing information flow. The
  360. light lines represent backup synchronization paths where timing
  361. information is exchanged, but not necessarily used to synchronize the
  362. local clocks. Figure 1b shows the same subnet, but with the line marked
  363. x out of service. The subnet has re-configured itself automatically to
  364. use backup paths, with the result that one of the servers has dropped
  365. from stratum 2 to stratum 3.
  366.  
  367. The following subsections contain an overview of the data formats,
  368. entities, state variables and procedures used in NTP. Further details
  369. are contained in the formal specification [22]. The specification is
  370. based on the implementation model illustrated below, but it is not
  371. intended that this model be the only one upon which a specification can
  372. be based. In particular, the specification is intended to illustrate and
  373. clarify the intrinsic operations of NTP and serve as a foundation for a
  374. more rigorous, comprehensive and verifiable specification.
  375.  
  376. @HEAD LEVEL 2 =  Determining Time and Frequency
  377.  
  378. Figure 2<$&fig2> shows the overall organization of the NTP time-server
  379. model. Timestamps exchanged between the server and possibly many other
  380. subnet peers are used to determine individual roundtrip delays and clock
  381. offsets, as well as provide reliable error estimates. Figure 3<$&fig3>
  382. shows how the timestamps are numbered and exchanged between server A and
  383. peer B. Let <$ET sub i>, <$ET sub {i-1}>, <$ET sub {i-2}>, <$ET sub {i-
  384. 3}> be the values of the four most recent timestamps as shown and let
  385. <$Ea~=~T sub {i-2}~-~T sub {i-3}> and <$Eb~=~T sub {i-1}~-~T sub i>.
  386. Then, the roundtrip delay <$Edelta sub i> and clock offset <$Etheta sub
  387. i> of B relative to A at time <$ET sub i> are:
  388.  
  389. @CENTER = <$Edelta sub i~=~a~-~b~~~~ and ~~~~theta sub i~=~{a~+~b} over
  390. 2> .
  391.  
  392. In the present NTP version (2) errors due to local-clock resolution and
  393. skew are minimized by the control-feedback design shown in Figure 2. In
  394. practice, errors due to stochastic network delays dominate; however, it
  395. is not usually possible to characterize network delays as a stationary
  396. random process, since network queues can grow and shrink in chaotic
  397. fashion and arriving customer traffic is frequently bursty.
  398.  
  399. Nevertheless, it is a simple exercise to calculate bounds on network
  400. errors as a function of measured delay. The true offset of B relative to
  401. A is called <$Etheta> in Figure 3. Let x denote the actual delay between
  402. the departure of a message from A and its arrival at B. Therefore,
  403. <$Ex~+~theta~=~T sub {i-2}~-~T sub {i-3}~==~a>. Since x must be positive
  404. in our universe, <$Ex~=~a~-~theta~>>=~0>, which requires
  405. <$Etheta~<<=~a>. A similar argument requires that <$Eb~<<=~theta>, so
  406. surely <$Eb~<<=~theta~<<=~a>. This inequality can also be expressed
  407.  
  408. @CENTER = <$Eb~=~{a~+~b} over 2~-~{a~-~b} over 2~<<=~theta~<<=~{a~+~b}
  409. over 2~+~{a~-~b} over 2~=~a> ,
  410.  
  411. which is equivalent to
  412.  
  413. @CENTER = <$Etheta sub i~-~delta sub i over 2~<<=~theta~<<=~theta sub
  414. i~+~delta sub i over 2> .
  415.  
  416. In other words, the true clock offset must lie in the interval of size
  417. equal to the measured delay and centered about the measured offset.
  418.  
  419. Each NTP message includes the latest three timestamps <$ET sub {i-1}>,
  420. <$ET sub {i-2}> and <$ET sub {i-3}>, while the fourth timestamp <$ET sub
  421. i> is determined upon arrival of the message. Thus, both the server and
  422. the peer can independently calculate delay and offset using a single
  423. message stream. This can be described as a symmetric, continuously
  424. sampled, time-transfer method similar to those used in some digital
  425. telephone networks [25]. Among its advantages are that the transmission
  426. times and received message orders are unimportant and that reliable
  427. delivery is not required. Obviously, the accuracies achievable depend
  428. upon the statistical properties of the outbound and inbound data paths.
  429. Further analysis and experimental results bearing on this issue can be
  430. found below and in [5], [19] and [20].
  431.  
  432. As shown in Figure 2, the computed delays and offsets are processed in
  433. the data filters to reduce incidental timing noise and the most accurate
  434. and reliable subset determined by the peer-selection algorithm. The
  435. resulting offsets of this subset are first combined on a weighted-
  436. average basis and then processed by a phase-lock loop (PLL). In the PLL
  437. the combined effects of the filtering, selection and combining
  438. operations are to produce a phase-correction term, which is processed by
  439. the loop filter to control the local clock, which functions as a
  440. voltage-controlled oscillator (VCO). The VCO furnishes the timing
  441. (phase) reference to produce the timestamps used in the above
  442. calculations.
  443.  
  444. @HEAD LEVEL 2 =  Modes of Operation
  445.  
  446. NTP time servers can operate in one of three service classes: multicast,
  447. procedure-call and symmetric. These classes are distinguished by the
  448. number of peers involved, whether synchronization is to be given or
  449. received and whether state information is retained. The multicast class
  450. is intended for use on high speed LANs with numerous workstations and
  451. where the highest accuracies are not required. In the typical scenario
  452. one or more time servers operating in multicast mode send periodic NTP
  453. broadcasts. The workstation peers operating in client mode then
  454. determine the time on the basis of an assumed delay in the order of a
  455. few milliseconds. By operating in multicast mode the server announces
  456. its willingness to provide synchronization to many other peers, but to
  457. accept NTP messages from none of them.
  458. The procedure-call class is intended for operation with file servers and
  459. workstations requiring the highest accuracies or where multicast mode is
  460. unavailable or inappropriate. In the typical scenario a time server
  461. operating in client mode sends an NTP message to a peer operating in
  462. server mode, which then interchanges the addresses, inserts the
  463. requested timestamps, recalculates the checksum and optional
  464. authenticator and returns the message immediately. By operating in
  465. client mode a server announces its willingness to be synchronized by,
  466. but not provide synchronization to a peer. By operating in server mode a
  467. server announces its willingness to provide synchronization to, but not
  468. be synchronized by a peer.
  469.  
  470. While the multicast and procedure-call classes may suffice on LANs
  471. involving public time servers and perhaps many private workstation
  472. clients, the full generality of NTP requires distributed participation
  473. of a number of time servers arranged in a dynamically reconfigurable,
  474. hierarchically distributed configuration. This is the motivation for the
  475. symmetric modes (active and passive). By operating in these modes a
  476. server announces its willingness to synchronize to or be synchronized by
  477. a peer, depending on the peer-selection algorithm. Symmetric active mode
  478. is designed for use by servers operating near the leaves (high stratum
  479. levels) of the synchronization subnet and with pre-configured peer
  480. addresses. Symmetric passive mode is designed for use by servers
  481. operating near the root (low stratum levels) and with a relatively large
  482. number of peers on an possibly intermittent basis.
  483.  
  484. When a pair of servers operating in symmetric modes first exchange
  485. messages, a loosely coupled connection or association is created. Each
  486. server creates an instantiation of the NTP protocol machine with
  487. persistent state variables; however, the main purpose of the protocol
  488. machine is not to assure delivery but to preserve timestamps and related
  489. information. In symmetric modes the servers refresh reachability status
  490. as each message is received and dissolve the association and recover
  491. state storage if this status has not been refreshed for a considerable
  492. time.
  493.  
  494. @HEAD LEVEL 2 =  Data Formats
  495.  
  496. All mathematical operations assumed in the protocol are two's-complement
  497. arithmetic with integer or fixed-point operands. Since NTP timestamps
  498. are cherished data and, in fact, represent the main product of the
  499. protocol, a special format has been established. An NTP timestamp is a
  500. 64-bit unsigned fixed-point number, with the integer part in the first
  501. 32 bits and the fraction part in the last 32 bits and interpreted in
  502. standard seconds relative to UTC. When UTC began at 0h on 1 January 1972
  503. the NTP clock was set to 2,272,060,800.0, representing the number of
  504. standard seconds since this time at 0h on 1 January 1900 (assuming no
  505. prior leap seconds).
  506.  
  507. This format allows convenient multiple-precision arithmetic and
  508. conversion to other formats used by various protocols of the Internet
  509. suite. The precision of this representation is about 232 picoseconds,
  510. which should be adequate for even the most exotic requirements. Note
  511. that since some time in 1968 the most significant bit of the 64-bit
  512. field has been set and that the field will overflow some time in 2036.
  513. Should NTP be in use in 2036, some external means will be necessary to
  514. qualify time relative to 1900 and subsequent 136-year cycles. Historic
  515. timestamped data of such precision and requiring such qualification will
  516. be so precious that appropriate means should be readily conceived.
  517.  
  518. Timestamps are determined by copying the current value of the local
  519. clock to a timestamp variable when some significant event occurs, such
  520. as the arrival of a message. In some cases a particular variable may not
  521. be available, such as when the server is rebooted or the protocol is
  522. restarted. In these cases the 64-bit field is set to zero, indicating an
  523. invalid or undefined value. There exists a 232-picosecond interval,
  524. henceforth ignored, every 136 years when the 64-bit field will naturally
  525. become zero and thus be considered invalid.
  526.  
  527. @HEAD LEVEL 2 =  State Variables
  528.  
  529. Following is a summary description of the important variables and
  530. parameters used by the protocol. In the symmetric modes a set of state
  531. variables is maintained for each association. In other modes these
  532. variables have a fleeting persistence lasting only until the reply
  533. message has been formulated and sent. Further discussion on some of
  534. these variables is given later in this paper. A complete description is
  535. given in [22].
  536.  
  537. Figure 4<$&fig4> shows the NTP packet-header format, which follows the
  538. IP and UDP headers. Following is a short description of the various
  539. fields.
  540.  
  541. @HANG = Leap Indicator (LI). Warns of an impending leap second to be
  542. inserted or deleted in the UTC timescale at the end of the current day.
  543.  
  544. @HANG = Version Number (VN). Identifies the present NTP version (2).
  545.  
  546. @HANG = Mode, Stratum, Precision. Indicate the current operating mode,
  547. stratum and local-clock precision.
  548.  
  549. @HANG = Poll Interval (Poll). The current desired interval between NTP
  550. messages sent. Each server uses the minimum of its own poll interval and
  551. that of the peer.
  552.  
  553. @HANG = Synchronization Distance, Synchronization Dispersion. Indicates
  554. the total roundtrip delay and total dispersion, respectively, to the
  555. primary reference source.
  556.  
  557. @HANG = Reference Clock Identifier, Reference Timestamp. Identifies the
  558. type of reference clock and the time of its last update; intended
  559. primarily for management functions.
  560.  
  561. @HANG = Originate Timestamp. The peer time when the last received NTP
  562. message was originated, copied from its transmit timestamp field upon
  563. arrival (<$ET sub {i-3}> above).
  564.  
  565. @HANG = Receive Timestamp. The local time when the latest NTP message
  566. was received (<$ET sub {i-2}> above).
  567.  
  568. @HANG = Transmit Timestamp. The local time when this NTP message was
  569. transmitted (<$ET sub {i-1}> above).
  570.  
  571. @HANG = Authenticator (optional). The key identifier and encrypted
  572. checksum of the message contents.
  573.  
  574. The NTP protocol machine maintains state variables for each of the above
  575. quantities and, in addition, other state variables, including the
  576. following:
  577.  
  578. @HANG = Addresses and Ports. The 32-bit Internet addresses and 16-bit
  579. port numbers of the server and peer, which serve to identify the
  580. association.
  581.  
  582. @HANG = Peer Timer. A counter used to control the intervals between
  583. transmitted NTP messages.
  584.  
  585. @HANG = Reachability Register. A shift register used to determine the
  586. reachability status of a peer.
  587. @HANG = Filter Register. A shift register used by the data-filtering
  588. algorithm, where each stage stores a tuple consisting of the measured
  589. delay and offset associated with a single delay/offset sample.
  590.  
  591. @HANG = Delay, Offset, Dispersion. Indicate the current roundtrip delay,
  592. clock offset and filter dispersion produced by the data-filtering
  593. algorithm.
  594.  
  595. @HANG = Synchronization Source. Identifies the peer currently used to
  596. synchronize the local clock, as determined by the peer-selection
  597. algorithm.
  598.  
  599. @HANG = Local Clock. The current local time as derived from the local
  600. clock.
  601.  
  602. @HEAD LEVEL 2 =  Procedures
  603.  
  604. The significant events of interest in NTP occur upon expiration of a
  605. peer timer, one of which is dedicated to each association, and upon
  606. arrival of an NTP message. An event can also occur as the result of an
  607. operator command or detected system fault, such as a primary reference
  608. source failure. This subsection briefly summarizes the procedures
  609. invoked when these events occur.
  610.  
  611. The transmit procedure is called when a peer timer decrements to zero.
  612. When this occurs the peer timer is reset and an NTP message is sent
  613. including the addresses, variables and timestamps described above. The
  614. value used to reset the timer is called the poll interval and is
  615. adjusted dynamically to reflect dispersive delays and reachability
  616. failures.
  617.  
  618. The receive procedure is called upon arrival of an NTP message, which is
  619. then matched with the association indicated by its addresses and ports.
  620. This results in the creation of a persistent association for a symmetric
  621. mode or a transient one for the other modes. Following a set of sanity
  622. checks the raw roundtrip delay and raw clock offset sample are
  623. calculated as described previously. A weighted voting procedure
  624. described in Section 4 determines the best in a sequence of raw samples
  625. and also an error estimator called the filter dispersion. The final
  626. values of roundtrip delay, clock offset and filter dispersion are
  627. determined using the minimum-filter algorithm described in Section 4.
  628.  
  629. The update procedure is called when a new set of estimates becomes
  630. available. A weighted voting procedure described in Section 4 determines
  631. the best peer, which may result in a new synchronization source, and
  632. also an error estimator called the select dispersion. If the
  633. synchronization source is the peer for which the estimates have just
  634. been produced, the estimated offset is used to adjust the local clock as
  635. described in Section 5. If due to a significant discrepancy the local
  636. clock is reset, rather than gradually slewed to its final value, the
  637. procedure expunges all timing information, resets the poll intervals and
  638. re-selects the synchronization source, if necessary. A new
  639. synchronization source will be determined when the data filters fill up
  640. again and the dispersions settle down.
  641.  
  642. @HEAD LEVEL 2 =  Robustness Issues
  643.  
  644. It has been the experience of the Internet community that something
  645. somewhere in the system is broken at any given time. This caveat applies
  646. to timecode receivers, time servers and synchronization paths, any of
  647. which can misbehave to produce a bogus timestamp popularly known as a
  648. timewarp. The very nature of time synchronization requires that it be
  649. extremely robust against timewarps and capable of operation even when
  650. major breakdowns or attempted break-ins occur. This subsection describes
  651. some of the measures taken to deal with these problems, including
  652. reachability, authentication and poll control.
  653. As shown previously, reliable time synchronization does not require
  654. reliable message delivery; however, in order to minimize resource
  655. requirements, resist using very old data and manage the memory resources
  656. required, a simple reachability protocol is used in which a peer is
  657. considered unreachable if no messages are received during eight
  658. consecutive poll intervals. In the active modes the peer is marked
  659. unreachable, but polls continue; while, in the passive modes the
  660. association is dissolved and its resources reclaimed for subsequent use.
  661.  
  662. Special sanity checks are provided to avoid disruptions due to system
  663. reboot, protocol restart or malfunction. For instance, if the transmit
  664. timestamp of a message is identical to one previously received, the
  665. message is a duplicate or replay and may contain bogus data. Since
  666. precision timestamps are difficult to spoof, the originate timestamp
  667. makes a fairly effective one-time pad. If a message contains an
  668. originate timestamp that does not match the transmit timestamp of the
  669. last message transmitted, the message is either out of order, from a
  670. previous association or bogus. Additional checks protect against using
  671. very old time information and from associations not completely
  672. synchronized.
  673.  
  674. Where security considerations require the highest level of protection
  675. against message modification, replay and other overt attacks, the NTP
  676. specification includes optional cryptographic authentication procedures.
  677. The procedures are used to insure an unbroken chain of authenticated
  678. associations within the synchronization subnet to the primary servers.
  679. An authenticator, consisting of a key identifier and encrypted checksum,
  680. is computed using the DES encryption algorithm [9] and DES cipher block-
  681. chaining method [10]. Some implementations incorporate special
  682. provisions to compensate for the delays inherent in the encryption
  683. computations.
  684.  
  685. Careful consideration was given during design to factors affecting
  686. network overheads. Some of the present Internet time servers operate
  687. with over 100 peers and a few operate with many more than that.
  688. Therefore, it is important that the longest poll intervals consistent
  689. with the required accuracy and stability be used. When reachability is
  690. first confirmed and when dispersions are high it is necessary to use a
  691. relatively wide PLL bandwidth, which requires a poll interval no greater
  692. than about a minute. When the association has stabilized and dispersions
  693. are low, the PLL bandwidth can be reduced to improve stability, which
  694. allows the poll interval to be increased substantially. In the present
  695. design the poll interval is increased gradually from about one minute to
  696. about 17 minutes as long as the filter dispersion is below an
  697. experimentally determined threshold; otherwise, it is decreased
  698. gradually to its original value.
  699.  
  700. @HEAD LEVEL 1 =  Filtering, Selection and Combining Operations
  701.  
  702. At the very heart of the NTP design are the algorithms used to improve
  703. the accuracy of the estimated delays and offsets between the various
  704. servers, as well as those used to select a particular peer for
  705. synchronization. The complexity of these algorithms depends on the
  706. statistical properties of the transmission path, as well as the
  707. accuracies and precisions required. Since Internet paths often involve
  708. multiple hops over networks of widely varying characteristics, it is not
  709. possible to design one set of algorithms optimized for a particular
  710. path. Another factor considered is to avoid the use of multiply/divide
  711. operations in favor of simple shifts in order to facilitate
  712. implementation on dedicated microprocessors.
  713.  
  714. A good deal of research has gone into mechanisms to synchronize clocks
  715. in a community where some clocks cannot be trusted. Determining whether
  716. a particular clock can be trusted is an interesting abstract problem
  717. which can be attacked using methods such as described in [14], [15],
  718. [18] and [31]. A number of algorithms for filtering, smoothing and
  719. classifying timekeeping data have been described in the literature [1],
  720. [6], [12], [13], [19], including convergence algorithms, which attempt
  721. to reduce errors by repeatedly casting out statistical outlyers, and
  722. consistency algorithms, which attempt to classify subsets of clocks as
  723. trusted or not by comparing statistics such as mean and variance. The
  724. NTP data-filtering algorithm, which attempts to improve the offset
  725. estimate for a single clock, given a series of observations, belongs to
  726. the former class. The NTP peer-selection algorithm, which attempts to
  727. find the best (i.e., the most reliable) clocks from a population,
  728. belongs to the latter class.
  729.  
  730. @HEAD LEVEL 2 =  Data-Filtering Algorithm
  731.  
  732. Interactive convergence algorithms use statistical clustering techniques
  733. such as the fault-tolerant average (FAT) algorithm of [12], the CNV
  734. algorithm of [17], the majority-subset algorithm of [19], the non-
  735. Byzantine algorithm of [30] and the egocentric algorithm of [31]. A
  736. variation on the FAT algorithm suggested in a recent paper [6] attempts
  737. to bound the offset errors when reading a remote clock by casting out
  738. readings where the measured roundtrip delay is above a specified value.
  739. This algorithm has features in common with the NTP data-filtering
  740. algorithm, but does not take advantage of the improved accuracy possible
  741. using a statistical analysis such as described in this section.
  742.  
  743. The NTP data-filtering algorithm, which has been evolved over several
  744. years of experimentation and experience with Internet paths, is designed
  745. specifically to provide high accuracy together with low computational
  746. burden. Recall that the roundtrip delay <$Edelta> and clock offset
  747. <$Etheta> are computed from the four most recent timestamps. Without
  748. making any assumptions about the delay distributions due to packet
  749. queueing in either direction along the path, but assuming the skew
  750. between the server and peer clocks is relatively small, let <$E( delta
  751. ,~theta )> represent the delay and offset when the path is otherwise
  752. idle and thus the true values. The problem is to produce an accurate
  753. estimator <$E( delta hat ,~theta hat )> from a sample population <$E(
  754. delta sub i ,~theta sub i )> collected for the path over an appropriate
  755. interval under normal traffic conditions.
  756.  
  757. The approach used in the design of the data-filtering algorithm was
  758. suggested by the observation that packet-switching networks are most
  759. often operated well below the knee of the throughput-delay curve, which
  760. means that packet queues are mostly small with relatively infrequent
  761. surges. In addition, the routing algorithm most often operates to
  762. minimize the number of packet-switch hops and thus the number of queues.
  763. Thus, not only is the probability that an NTP packet finds a busy queue
  764. in one direction relatively low, but the probability of packets from a
  765. single exchange finding busy queues in both directions is even lower.
  766. Therefore, the best offset samples should occur at the lowest delays,
  767.  
  768. This observation suggests the design of a minimum filter, which selects
  769. from the n most recent samples <$E( delta sub i ,~theta sub i )>, <$E(
  770. delta sub {i-1} ,~theta sub {i-1} )>, ..., <$E( delta sub {i-n+1}
  771. ,~theta sub {i-n+1} )> the sample with lowest delay <$Edelta sub j> and
  772. produces <$E( delta sub j ,~theta sub j )> as the estimator <$E( delta
  773. hat ,~theta hat )>. Several experiments were made to evaluate this
  774. design using measurements between NTP primary servers, so that delays
  775. and offsets could be determined independently of the measurement
  776. procedure itself [24]. The experiments were performed over several paths
  777. involving ARPANET, NSFNET and various LANs and using minimum filters and
  778. various other algorithms based on median and trimmed-mean statistics.
  779. The results show consistently lower errors for the minimum filter when
  780. compared the other algorithms. Perhaps the most dramatic result with the
  781. minimum filter is the greatly reduced maximum error under conditions of
  782. high levels of network traffic.
  783. The delay/offset characteristics of a typical Internet path are
  784. illustrated in Figure 5<$&fig5>, which is a scatter diagram plotting
  785. <$Etheta> versus <$Edelta> points for a path between primary servers on
  786. the east and west coasts over an interval of about a week. This
  787. particular path involves seven networks and twelve gateways and is among
  788. the most complex in the NTP synchronization subnet. Under low-traffic
  789. conditions the points are concentrated about the apex of the wedge and
  790. begin to extend rightward along the extrema lines as the network traffic
  791. increases. As the traffic continues to increase, the points begin to
  792. fill in the wedge as it expands even further rightward. This behavior is
  793. characteristic of typical Internet paths involving ARPANET, NSFNET and
  794. regional networks. From these data it is obvious that good estimators
  795. <$E( delta hat ,~theta hat )> are points near the apex, which is exactly
  796. what the minimum filter is designed to produce.
  797.  
  798. In the reference implementation, samples <$E( delta sub i,~theta sub i
  799. )> are shifted into an eight-stage shift register from one end, causing
  800. old samples to shift off the other. Then, all eight samples are placed
  801. on a temporary list and sorted in order of increasing <$Edelta>. The
  802. first sample on the list <$E( delta sub 0 ,~theta sub 0 )> represents
  803. the estimators <$E( delta hat ,~theta hat )>, which are recorded for
  804. each peer separately for later processing by the selection and combining
  805. algorithms.
  806.  
  807. The filter dispersion is interpreted as a quality indicator, with
  808. increasing values associated with decreasing quality and weight in the
  809. selection and combining algorithms. A good estimator which counts
  810. samples near the apex of the wedge most heavily and is easily computable
  811. is the weighted differences of the <$Etheta sub i> in the sorted
  812. temporary list relative to <$Etheta sub 0>. Assume the list has
  813. <$En~>>~1> entries (<$En~=~8 > in this case) with <$E( delta sub
  814. j,~theta sub j )> <$E(j~=~0,~1,~...,~n~-~1)> samples in order of
  815. increasing <$Edelta sub i>. The filter dispersion <$Eepsilon> is defined
  816.  
  817. @CENTER = <$Eepsilon ~=~sum from {j~=~0} to {n~-~1}~| theta sub j~-
  818. ~theta sub 0 |~v sup {~j}> ,
  819.  
  820. where v is an experimentally adjusted weight factor, <$Ev~=~0.5> in the
  821. reference implementation. The filter dispersion is recorded for each
  822. peer separately for later processing by the selection and combining
  823. algorithms.
  824.  
  825. @HEAD LEVEL 2 =  Peer-Selection and Combining Algorithms
  826.  
  827. The single most important contributing factor in maintaining high
  828. reliability with NTP is the peer-selection and combining algorithms.
  829. When new offset estimates are produced for a peer or are revised as the
  830. result of timeout, this mechanism is used to determine which peer should
  831. be selected as the synchronization source and how to adjust the local-
  832. clock, stratum and related variables.
  833.  
  834. Interactive consistency algorithms are designed to tolerate faulty clock
  835. processes which might indicate grossly inconsistent offsets in
  836. successive readings or to different readers. These algorithms use an
  837. agreement protocol involving successive rounds of readings, possibly
  838. relayed and possibly augmented by digital signatures. Examples include
  839. the fireworks algorithm of [12] and the optimum algorithm of [33].
  840. However, these algorithms as described require an excessive burden of
  841. messages, especially when large numbers of clocks are involved, and
  842. require statistically awkward assumptions in order to certify
  843. correctness.
  844.  
  845. While drawing upon the technology of agreement algorithms, the NTP peer-
  846. selection algorithm is not strictly one of them, but an adaptation based
  847. on maximum-likelihood statistical principles and the pragmatic
  848. observation that the highest reliability is usually associated with the
  849. lowest stratum and synchronization dispersion, while the highest
  850. accuracy is usually associated with the lowest stratum and
  851. synchronization distance. A key design assumption is that truechimers
  852. are relatively numerous and represented by random variables narrowly
  853. distributed about UTC in the measurement space, while falsetickers are
  854. relatively rare and represented by random variables widely distributed
  855. throughout the measurement space.
  856.  
  857. The peer-selection algorithm begins by constructing a list of candidate
  858. peers sorted first by stratum and then by synchronization dispersion. To
  859. be included on the candidate list a peer must pass several sanity checks
  860. designed to detect blatant errors and defective implementations. If no
  861. peers pass the sanity checks, the existing synchronization source, if
  862. any, is cancelled and the local clock free-runs at its intrinsic
  863. frequency. The list is then pruned from the end to a predetermined
  864. maximum size and maximum stratum.
  865.  
  866. The next step is designed to detect falsetickers or other conditions
  867. which might result in gross errors. The candidate list is re-sorted in
  868. the order first by stratum and then by synchronization distance. Let
  869. <$Em~>>~0> be the number of candidates remaining in the list and let
  870. <$Etheta sub j> be the offset of the jth candidate. For each
  871. <$Ej~(0~<<=~j~<<~m)> the select dispersion <$Eepsilon sub j> relative to
  872. candidate j is defined
  873.  
  874. @CENTER = <$Eepsilon sub j~=~sum from {k~=~0} to {m~-~1}~| theta sub j~-
  875. ~theta sub k |~w sup {~k}> ,
  876.  
  877. where w is a factor experimentally adjusted for the desired
  878. characteristic (see below). Then discard the candidate with maximum
  879. <$Eepsilon sub j> or, in case of ties the maximum j, and repeat the
  880. procedure. The procedure terminates when the maximum select dispersion
  881. over all candidates remaining on the list is less than the minimum
  882. filter dispersion of any candidate or until only a single candidate
  883. remains.
  884.  
  885. The above procedures are designed to favor those peers near the
  886. beginning of the candidate list, which are at the lowest stratum and
  887. lowest delay and presumably can provide the most accurate time. With
  888. proper selection of weight factor w, outlyers will be discarded from the
  889. end of the list, unless some other entry disagrees significantly with
  890. respect to the remaining entries, in which case that entry is discarded.
  891. For example, with <$Ew~=~0.75> as used in the reference implementation,
  892. a single stratum-2 server at the end of the candidate list will swing
  893. the vote between two stratum-1 servers that disagree with each other.
  894. While these outcomes depend on judicious choice of w, the behavior of
  895. the algorithm is substantially the same for values of w between 0.5 and
  896. 1.0.
  897.  
  898. The offsets of the peers remaining on the candidate list are
  899. statistically equivalent, so any of them can be chosen to adjust the
  900. local clock. Some implementations combine them using a weighted-average
  901. algorithm similar to that described in [1], in which the offsets of the
  902. peers remaining on the list are weighted by estimated error to produce a
  903. combined estimate. In these implementations the error estimate is taken
  904. to be the reciprocal of synchronization dispersion.
  905.  
  906. The update procedure also sets the local stratum to one greater than the
  907. stratum of the selected peer. In addition, the server synchronization
  908. distance - the sum of the total roundtrip delays to the root of the
  909. synchronization subnet, as well as the server synchronization dispersion
  910. - the sum of the total dispersions to the root of the synchronization
  911. subnet, are calculated and recorded in a system state variable. All
  912. three of these quantities are included in the NTP message header.
  913.  
  914. @HEAD LEVEL 1 =  Local-Clock Design
  915. Precision timekeeping requires an exceptionally stable local oscillator
  916. reference in order to deliver accurate time when the synchronization
  917. path to a primary server has failed. Furthermore, the oscillator and
  918. control loop must maintain accurate time and stable frequency over wide
  919. variations in synchronization path delays. In the NTP local-clock model
  920. the fundamental system time reference, or logical clock, increments at
  921. some standard rate such as 1000 Hz and can be adjusted to precise time
  922. and frequency by means of periodic corrections determined by NTP, a
  923. timecode receiver or a calibrated atomic clock.
  924.  
  925. The model shown in Figure 6<$&fig6> can be described as a type-II,
  926. adaptive-parameter, phase-lock loop (PLL), which continuously corrects
  927. local oscillator phase and frequency variations relative to received
  928. updates. The difference between the peer time and server time <$ET sub
  929. B~-~T sub A>; that is, the offset <$Etheta> shown in Figure 3, is
  930. processed by the phase detector PD to produce the output <$EV sub d>.
  931. The filtering, selection and combining algorithms shown in Figure 2
  932. operate as a variable delay network to produce the output <$EV sub s>.
  933. The loop filter produces the output <$EV sub c>, which is used to adjust
  934. the frequency of the voltage-controlled oscillator VCO in order to
  935. reduce the offset <$Etheta>.
  936.  
  937. Using familiar techniques of analysis [32], the (open-loop) transfer
  938. function of the PLL can be approximated as
  939.  
  940. @CENTER = <$EF(s)~=~{ omega sub c sup 2 } over { s sup 2 tau sup 2
  941. }~(1~+~{ s tau } over { omega sub z})~e sup {-s T }> ,
  942.  
  943. where <$Eomega sub c> is the gain (crossover frequency), <$Eomega sub z>
  944. the corner frequency of the lead network (necessary for PLL stability),
  945. T is the data-filter delay and <$Etau> is a parameter used for bandwidth
  946. control. Simulation of the entire PLL with the variables and constants
  947. specified in [22] results in the following characteristics: At the
  948. widest bandwidth (smallest <$Etau >) and a 100-ms phase change the PLL
  949. reaches zero error in 39 minutes, overshoots 7 ms in 54 minutes and
  950. settles to less than 1 ms in about six hours.
  951.  
  952. Bandwidth control is necessary to match the PLL dynamics to varying
  953. levels of timing noise due to the intrinsic stability of the local
  954. oscillator and the prevailing delay variances in the network. On one
  955. hand, the PLL must track room-temperature quartz oscillators found in
  956. common computing equipment, where the frequency may be accurate to only
  957. .01 percent and may vary several parts-per-million (ppm) as the result
  958. of normal room-temperature variations. On the other hand, after the
  959. frequency errors have been tracked for several days, and assuming the
  960. local oscillator is appropriately compensated, the loop must maintain
  961. stabilities to the order of .01 ppm. The NTP PLL is designed to adapt
  962. automatically to these regimes by measuring the dispersions and
  963. adjusting <$Etau> over a five-octave range. Design details are discussed
  964. in [22] and performance assessed in [24].
  965.  
  966. @HEAD LEVEL 1 =  NTP in the Internet System
  967.  
  968. The penetration of NTP in the Internet has steadily increased over the
  969. last few years. It is estimated that well over 2000 hosts presently
  970. synchronize local clocks to UTC using NTP and the Internet primary
  971. servers. In this section an overview of the various NTP implementations
  972. and subnet configurations is presented along with an evaluation of
  973. performance expected in routine operation.
  974.  
  975. The Fuzzball [21] is a software package consisting of a fast, compact
  976. operating system and an array of application programs for network
  977. protocol development, testing and evaluation. It usually runs on a DEC
  978. LSI-11 personal workstation, which functions as an experiment platform
  979. capable of millisecond timing accuracies and supports several types of
  980. timecode receivers and precision timebases. Since NTP and its forebears
  981. were developed and tested on the Fuzzball, the present implementation is
  982. the reference one for the NTP specification. An implementation of NTP
  983. for Unix systems was built by Michael Petry and Louis Mamakos at the
  984. University of Maryland. An implementation of NTP for Unix systems and
  985. for a dedicated Motorola 68000 microprocessor was built by Dennis
  986. Ferguson at the University of Toronto. Both Unix implementations adjust
  987. the local-clock phase and frequency using kernel primitives designed for
  988. this purpose and support various types of timecode receivers. Other
  989. implementations are in progress at Hewlett-Packard Laboratories,
  990. University College London and University of Delaware.
  991.  
  992. The NTP primary synchronization subnet now operating in the Internet
  993. consists of over two dozen Fuzzball and Unix primary time servers
  994. located in the U.S., Canada, the United Kingdom and Norway. All servers
  995. are synchronized to UTC via radio or satellite. Two servers use
  996. calibrated atomic clocks and two use LORAN-C timing receivers as
  997. precision timebases. Six servers are connected directly to national
  998. backbone networks, including NSFNET and ARPANET, and are intended for
  999. ubiquitous access, while the remainder are connected to regional
  1000. networks and intended for regional and local access. All primary servers
  1001. continuously exchange NTP messages with most of the other primary
  1002. servers, which provides an exceptional level of redundancy and
  1003. protection against failures. For instance, if a timecode receiver fails,
  1004. a primary (stratum-1) server synchronizes via NTP to the nearest primary
  1005. peer and continues operation as a secondary (stratum-2) server. If a
  1006. primary server turns falseticker, discrepancies become apparent to its
  1007. NTP peers, which then deselect the server as the result of the
  1008. algorithms described previously.
  1009.  
  1010. The NTP secondary synchronization subnet presently includes an estimated
  1011. total of over 2000 secondary time servers using some thousands of
  1012. transmission paths on hundreds of networks. A secondary server operating
  1013. at stratum <$En~>>~1> ordinarily operates with at least three peers, two
  1014. at stratum <$En~-~1> and one or more at stratum n. In the most robust
  1015. configurations a set of servers agree to provide backup service for each
  1016. other, so run NTP with some of the stratum-(<$En~-~1>) servers and some
  1017. of the other stratum-n servers in the same set. In a typical example
  1018. configuration used at the University of Illinois and the University of
  1019. Delaware the institution operates three stratum-2 campus servers, each
  1020. operating with two out of six different stratum-1 primary servers and
  1021. with each other. The three campus servers in turn provide
  1022. synchronization for several stratum-3 department servers, each operating
  1023. with all three campus servers. Department servers, many of which also
  1024. function as file servers, then deliver time to possibly hundreds of
  1025. stratum-4 workstations in client/server or multicast modes.
  1026.  
  1027. As part of normal operations the Fuzzball time servers monitor delay and
  1028. offset data from each of their peers. Periodically, these data are
  1029. collected and analyzed to construct scatter diagrams, time-series
  1030. diagrams and distribution functions. Scatter diagrams such as Figure 5
  1031. have proven exquisitely sensitive indicators of network performance and
  1032. possible malfunctions. Time-series diagrams showing absolute offsets
  1033. such as Figure 7<$&fig7>, constructed from the same data as Figure 5,
  1034. are useful for assessing algorithm performance and systematic errors.
  1035. Distribution functions plotted on log-log axes such as Figure 8<$&fig8>,
  1036. also constructed from the same data, are useful in evaluating the
  1037. performance of data-filtering algorithms. The figure shows the absolute
  1038. raw offsets (upper curve) and filtered offsets (lower curve), from which
  1039. it is apparent that the maximum error after the filter is less than
  1040. about 30 ms for all but about one percent of the samples and less than
  1041. about 50 ms for all samples. A companion paper [24] contains an extended
  1042. discussion of performance issues and concludes that, using the adaptive-
  1043. parameter PLL model described above together with the new combining
  1044. algorithm, timing accuracies to a few milliseconds and frequency
  1045. stabilities to a few milliseconds per day are regularly achieved.
  1046. @HEAD LEVEL 1 =  Future Directions
  1047.  
  1048. The IRIG-H timecode format established in 1970 and used since then by
  1049. NBS/NIST radio broadcast services does not include either year
  1050. information or advance notice of leap-second insertion. Currently, this
  1051. information must be provided at the primary servers by other means. It
  1052. is reported (personal communication) that this information will soon be
  1053. available in at least some radio services. In fact, the recently
  1054. introduced NIST telephone time service [26] already includes both the
  1055. year and advance leap-second information.
  1056.  
  1057. The current mechanism of time delivery using dedicated radio systems and
  1058. multifunction radionavigation and land-resources satellite systems
  1059. requires relatively expensive timecode receivers subject to occasional
  1060. disruption due to propagation path or radio failure. A plan once
  1061. proposed by NIST using national television networks for time transfer
  1062. has been generally thwarted by the growing use of buffered frame
  1063. regeneration at the local stations. However, the growing penetration of
  1064. cable television systems suggests a new opportunity for time
  1065. distribution, such as providing incentives for cable operators to
  1066. rebroadcast WWV, for example. An agenda should be pursued to promote the
  1067. installation of NTP primary servers with Internet connectivity at
  1068. various national standards laboratories. In fact, a pilot project is now
  1069. in operation at the Norwegian Telecommunications Administration Research
  1070. Establishment, in which Fuzzball primary NTP servers are synchronized
  1071. directly to the Norwegian national standards.
  1072.  
  1073. As experience accumulates, improvements are being made continuously to
  1074. the filtering and selection algorithms described in this paper. Recent
  1075. improvements now being tested include engineered budgets for reading
  1076. errors and skew-error accumulation, as well as an improved peer-
  1077. selection algorithm based on the work of Marzullo and Owicki [18]. The
  1078. goal is to provide reliable timing and timing-error information while
  1079. preserving correctness, stability and accuracy. There may also be room
  1080. for additional improvements in the offset-combination algorithm recently
  1081. introduced, for example, as well as methods to compensate for asymmetric
  1082. delays commonly found on Internet paths. Other improvements being
  1083. considered include automatic subnet configuration and dynamic activation
  1084. of peer associations when other peer associations become unreachable.
  1085. These features are intended to reduce the network overhead when a large
  1086. number of possible peers are available, but only a few are needed for
  1087. reliable synchronization.
  1088.  
  1089. At present, NTP support is available only for Fuzzball and Unix systems.
  1090. Support is needed for other systems, including mainframes and personal
  1091. workstations of various manufacture. While NTP has been evolved within
  1092. the Internet protocol suite, there is obvious application to the OSI
  1093. protocol suite, in particular the protocols of the connectionless (CNLS)
  1094. branch of that suite. Perhaps the most attractive methodology would be
  1095. to integrate NTP functions directly into the ES-IS and IS-IS routing
  1096. functions and network management systems.
  1097.  
  1098. @HEAD LEVEL 1 =  Acknowledgments
  1099.  
  1100. Acknowledgments are due the referees for valuable suggestions on this
  1101. paper. Thanks are due to the tribe of volunteer timetrekkers, too
  1102. numerous to list here, who have assisted in the implementation and
  1103. testing projects leading to the deployment of NTP. Thanks are also due
  1104. the U.S. Coast Guard, who kindly provided a cesium clock and LORAN-C
  1105. receiver on loan, as well as the U.S. Naval Observatory, who provided
  1106. calibration assistance and much useful advice.
  1107.  
  1108. @HEAD LEVEL 1 =  References
  1109.  
  1110. @INDENT HEAD = 1.
  1111. @INDENT = Allan, D.W., J.E. Gray and H.E. Machlan. The National Bureau
  1112. of Standards atomic time scale: generation, stability, accuracy and
  1113. accessibility. In: Blair, B.E. (Ed.). Time and Frequency Theory and
  1114. Fundamentals. National Bureau of Standards Monograph 140, U.S.
  1115. Department of Commerce, 1974, 205-231.
  1116.  
  1117. @INDENT HEAD = 2.
  1118.  
  1119. @INDENT = Bell Communications Research. Digital Synchronization Network
  1120. Plan. Technical Advisory TA-NPL-000436, 1 November 1986.
  1121.  
  1122. @INDENT HEAD = 3.
  1123.  
  1124. @INDENT = Bertsekas, D., and R. Gallager. Data Networks. Prentice-Hall,
  1125. Englewood Cliffs, NJ, 1987.
  1126.  
  1127. @INDENT HEAD = 4.
  1128.  
  1129. @INDENT = Blair, B.E. Time and frequency dissemination: an overview of
  1130. principles and techniques. In: Blair, B.E. (Ed.). Time and Frequency
  1131. Theory and Fundamentals. National Bureau of Standards Monograph 140,
  1132. U.S. Department of Commerce, 1974, 233-313.
  1133.  
  1134. @INDENT HEAD = 5.
  1135.  
  1136. @INDENT = Cole, R., and C. Foxcroft. An experiment in clock
  1137. synchronisation. The Computer Journal 31, 6 (1988), 496-502.
  1138.  
  1139. @INDENT HEAD = 6.
  1140.  
  1141. @INDENT = Cristian, F. A probabilistic approach to distributed clock
  1142. synchronization. Proc. Ninth IEEE International Conference on
  1143. Distributed Computing Systems (June 1989), 288-296.
  1144.  
  1145. @INDENT HEAD = 7.
  1146.  
  1147. @INDENT = Defense Advanced Research Projects Agency. Internet Control
  1148. Message Protocol. DARPA Network Working Group Report RFC-792, USC
  1149. Information Sciences Institute, September 1981.
  1150.  
  1151. @INDENT HEAD = 8.
  1152.  
  1153. @INDENT = Defense Advanced Research Projects Agency. Internet Protocol.
  1154. DARPA Network Working Group Report RFC-791, USC Information Sciences
  1155. Institute, September 1981.
  1156.  
  1157. @INDENT HEAD = 9.
  1158.  
  1159. @INDENT = Data Encryption Standard. Federal Information Processing
  1160. Standards Publication 46. National Bureau of Standards, U.S. Department
  1161. of Commerce, 1977.
  1162.  
  1163. @INDENT HEAD = 10.
  1164.  
  1165. @INDENT = DES Modes of Operation. Federal Information Processing
  1166. Standards Publication 81. National Bureau of Standards, U.S. Department
  1167. of Commerce, December 1980.
  1168.  
  1169. @INDENT HEAD = 11.
  1170.  
  1171. @INDENT = Gusella, R., and S. Zatti. TEMPO - A network time controller
  1172. for a distributed Berkeley UNIX system. IEEE Distributed Processing
  1173. Technical Committee Newsletter 6, NoSI-2 (June 1984), 7-15. Also in:
  1174. Proc. Summer 1984 USENIX (Salt Lake City, June 1984).
  1175.  
  1176. @INDENT HEAD = 12.
  1177. @INDENT = Halpern, J.Y., B. Simons, R. Strong and D. Dolly. Fault-
  1178. tolerant clock synchronization. Proc. Third Annual ACM Sympos. on
  1179. Principles of Distributed Computing (August 1984), 89-102.
  1180.  
  1181. @INDENT HEAD = 13.
  1182.  
  1183. @INDENT = Kopetz, H., and W. Ochsenreiter. Clock synchronization in
  1184. distributed real-time systems. IEEE Trans. Computers C-36, 8 (August
  1185. 1987), 933-939.
  1186.  
  1187. @INDENT HEAD = 14.
  1188.  
  1189. @INDENT = Lamport, L., Time, clocks and the ordering of events in a
  1190. distributed system. Comm. ACM 21, 7 (July 1978), 558-565.
  1191.  
  1192. @INDENT HEAD = 15.
  1193.  
  1194. @INDENT = Lamport, L., and P.M. Melliar-Smith. Synchronizing clocks in
  1195. the presence of faults. JACM 32, 1 (January 1985), 52-78.
  1196.  
  1197. @INDENT HEAD = 16.
  1198.  
  1199. @INDENT = Lindsay, W.C., and A.V. Kantak. Network synchronization of
  1200. random signals. IEEE Trans. Communications COM-28, 8 (August 1980),
  1201. 1260-1266.
  1202.  
  1203. @INDENT HEAD = 17.
  1204.  
  1205. @INDENT = Lundelius, J., and N.A. Lynch. A new fault-tolerant algorithm
  1206. for clock synchronization. Proc. Third Annual ACM Sympos. on Principles
  1207. of Distributed Computing (August 1984), 75-88.
  1208.  
  1209. @INDENT HEAD = 18.
  1210.  
  1211. @INDENT = Marzullo, K., and S. Owicki. Maintaining the time in a
  1212. distributed system. ACM Operating Systems Review 19, 3 (July 1985), 44-
  1213. 54.
  1214.  
  1215. @INDENT HEAD = 19.
  1216.  
  1217. @INDENT = Mills, D.L. Algorithms for synchronizing network clocks. DARPA
  1218. Network Working Group Report RFC-956, M/A-COM Linkabit, September 1985.
  1219.  
  1220. @INDENT HEAD = 20.
  1221.  
  1222. @INDENT = Mills, D.L. Experiments in network clock synchronization.
  1223. DARPA Network Working Group Report RFC-957, M/A-COM Linkabit, September
  1224. 1985.
  1225.  
  1226. @INDENT HEAD = 21.
  1227.  
  1228. @INDENT = Mills, D.L. The Fuzzball. Proc. ACM SIGCOMM 88 Symposium (Palo
  1229. Alto, CA, August 1988), 115-122.
  1230.  
  1231. @INDENT HEAD = 22.
  1232.  
  1233. @INDENT = Mills, D.L. Network Time Protocol (Version 2) specification
  1234. and implementation. DARPA Network Working Group Report RFC-1119,
  1235. University of Delaware, September 1989.
  1236.  
  1237. @INDENT HEAD = 23.
  1238.  
  1239. @INDENT = Mills, D.L. Internet time synchronization: the Network Time
  1240. Protocol. DARPA Network Working Group Report RFC-1129, University of
  1241. Delaware, October 1989.
  1242. @INDENT HEAD = 24.
  1243.  
  1244. @INDENT = Mills, D.L. On the accuracy and stability of clocks
  1245. synchronized by the Network Time Protocol in the Internet system. ACM
  1246. Computer Communication Review 20, 1 (January 1990), 65-75.
  1247.  
  1248. @INDENT HEAD = 25.
  1249.  
  1250. @INDENT = Mitra, D. Network synchronization: analysis of a hybrid of
  1251. master-slave and mutual synchronization. IEEE Trans. Communications COM-
  1252. 28, 8 (August 1980), 1245-1259.
  1253.  
  1254. @INDENT HEAD = 26.
  1255.  
  1256. @INDENT = Automated Computer Time Service (ACTS). NBS Research Material
  1257. 8101, U.S. Department of Commerce, 1988.
  1258.  
  1259. @INDENT HEAD = 27.
  1260.  
  1261. @INDENT = Postel, J. User Datagram Protocol. DARPA Network Working Group
  1262. Report RFC-768, USC Information Sciences Institute, August 1980.
  1263.  
  1264. @INDENT HEAD = 28.
  1265.  
  1266. @INDENT = Postel, J. Daytime protocol. DARPA Network Working Group
  1267. Report RFC-867, USC Information Sciences Institute, May 1983.
  1268.  
  1269. @INDENT HEAD = 29.
  1270.  
  1271. @INDENT = Postel, J. Time protocol. DARPA Network Working Group Report
  1272. RFC-868, USC Information Sciences Institute, May 1983.
  1273.  
  1274. @INDENT HEAD = 30.
  1275.  
  1276. @INDENT = Rickert, N.W. Non Byzantine clock synchronization - a
  1277. programming experiment. ACM Operating Systems Review 22, 1 (January
  1278. 1988), 73-78.
  1279.  
  1280. @INDENT HEAD = 31.
  1281.  
  1282. @INDENT = Schneider, F.B. A paradigm for reliable clock synchronization.
  1283. Department of Computer Science Technical Report TR 86-735, Cornell
  1284. University, February 1986.
  1285.  
  1286. @INDENT HEAD = 32.
  1287.  
  1288. @INDENT = Smith, J. Modern Communications Circuits. McGraw-Hill, New
  1289. York, NY, 1986.
  1290.  
  1291. @INDENT HEAD = 33.
  1292.  
  1293. @INDENT = Srikanth, T.K., and S. Toueg. Optimal clock synchronization.
  1294. JACM 34, 3 (July 1987), 626-645.
  1295.  
  1296. @INDENT HEAD = 34.
  1297.  
  1298. @INDENT = Su, Z. A specification of the Internet protocol (IP) timestamp
  1299. option. DARPA Network Working Group Report RFC-781. SRI International,
  1300. May 1981.
  1301.